package o;

import androidx.annotation.NonNull;
import o.aat.a;
import o.aat.d;
import o.hg.e;

final class tr<Z> implements tx<Z>, d {
    private static final e<tr<?>> ˎ = aat.ॱ(20, new a<tr<?>>() {
        public /* synthetic */ Object ॱ() {
            return ˋ();
        }

        public tr<?> ˋ() {
            return new tr();
        }
    });
    private boolean ˊ;
    private tx<Z> ˋ;
    private final abb ˏ = abb.ˊ();
    private boolean ॱ;

    @NonNull
    static <Z> tr<Z> ˏ(tx<Z> txVar) {
        tr<Z> trVar = (tr) aas.ˎ((tr) ˎ.ˎ());
        trVar.ॱ(txVar);
        return trVar;
    }

    tr() {
    }

    private void ॱ(tx<Z> txVar) {
        this.ˊ = false;
        this.ॱ = true;
        this.ˋ = txVar;
    }

    private void ᐝ() {
        this.ˋ = null;
        ˎ.ˋ(this);
    }

    synchronized void ˊ() {
        this.ˏ.ˎ();
        if (this.ॱ) {
            this.ॱ = false;
            if (this.ˊ) {
                ॱॱ();
            }
        } else {
            throw new IllegalStateException("Already unlocked");
        }
    }

    @NonNull
    public Class<Z> ˎ() {
        return this.ˋ.ˎ();
    }

    @NonNull
    public Z ˋ() {
        return this.ˋ.ˋ();
    }

    public int ॱ() {
        return this.ˋ.ॱ();
    }

    public synchronized void ॱॱ() {
        this.ˏ.ˎ();
        this.ˊ = true;
        if (!this.ॱ) {
            this.ˋ.ॱॱ();
            ᐝ();
        }
    }

    @NonNull
    public abb ˏ() {
        return this.ˏ;
    }
}
